package cn.catsdad.base.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;

import javax.persistence.MappedSuperclass;
import java.util.Date;

/**
 * @author xuyl
 * @version 1.0 2024/8/29
 */
@EqualsAndHashCode(callSuper = true)
@Data
@MappedSuperclass
public abstract class BaseCrudEntity extends BaseEntity {

    /**
     * 创建时间
     */
    @CreatedDate
    private Date createdTime;

    /**
     * 创建人id
     */
    @CreatedBy
    private long creatorId;

    /**
     * 修改时间
     */
    @LastModifiedDate
    private Date modifiedTime;

    /**
     * 修改人id
     */
    @LastModifiedBy
    private long modifierId;

    /**
     * 假删字段
     */
    private Boolean isDeleted = false;
}
